const { STRING, INTEGER, BIGINT, NOW } = require("sequelize")
const seq = require("./seq")

// 定义模型
const Comment = seq.define("Comment", {
  itemId: {
    type: INTEGER,
    allowNull: false,
    comment: "商品id"
  },
  userId: {
    type: INTEGER,
    allowNull: false,
    comment: "用户id"
  },
  content: {
    type: STRING(2000),
    allowNull: false,
    comment: "商品名称"
  },
  createdAt: {
    type: BIGINT,
    defaultValue: Date.now(),
    comment: "创建时间"
  }
}, {
  timestamps: false,
  underscored: true
})

// 发布模型
module.exports = Comment
